# 获取area对象
def to_area(area):
    data = {
        "id":area.id,
        "name":area.name,
        "score":area.score
    }
    if area.childs:
        data["childs"]=to_areas(area.childs)
    return data

# 获取areas的列表
def to_areas(areas):
    re_areas = []
    for area in areas:
        re_areas.append(area)
    return re_areas